<? $page_title='材料信息' ?>
<? include "FASHION/page_header.phtml" ?>

<form method="get">
<div class="nobr">
	<input type="button" class="button" value="添加材料" onclick="g2('<? url('ware-add') ?>')" />
	&nbsp; &nbsp; 关键字:
	<input type="text" name="title" size="12" value="<?= fetch_a_string('title') ?>" />
	<input type="submit" value="检索" class="button" />
	<input type="hidden" name="page" value="1" />
</div>
</form>

<table class="list">
<tr class="nobg" >
	<th>编号</th>
	<th>材料名称</th>
	<th>品牌</th>
	<th>规格</th>
	<th width="50">单位</th>
	<th width="60">操作</th>
</tr>
<{if $wares}>
<{foreach item=ware from=$wares}>
<TR class="row">
	<TD ><{$ware.sno}></TD>
	<TD><{$ware.name}></TD>
	<TD class="center"><{$ware.brand}></TD>
	<TD><{$ware.specific}></TD>
	<TD class="center"><{$ware.unit}></TD>
	<TD>
		<a href="<? url('ware-modify/id/'.$ware.id) ?>">修改</a>
		<a href="#" onclick="dropware(<{$ware.id}>)">删除</a>
	</TD>
</TR>
<{/foreach}>
<{/if}>
</TABLE>

<? Html::pager($pager) ?>

<script language="JavaScript">
function dropware(wareid)
{
	if(confirm("确认要删除此材料信息？")) {
		$.get("<? url('ware-del/id/ID') ?>".replace('ID',wareid), function(jsn){
			show_alert(jsn.message);
			if(ajax_ok(jsn)){
				location.reload();
			}
			else{
				show_alert('删除失败!');
			}
		});
	}
}
</script>

<? include "FASHION/page_footer.phtml" ?>
